home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr53 / pctv4n_1.zip / PLAYERIN.TXT < prev    next >
Text File  |  1993-06-10  |  963b  |  36 lines

  1. ' Listing 3 - PlayerIn.Frm
  2. Dim LevelText(1 To 3) As String
  3.  
  4. Sub LevelButton_Click (Index As Integer)
  5.     NewValue% = LevelButton(Index).Value
  6.     Players(Index + 1).Level = NewValue%
  7.     LevelButton(Index).Caption = "Difficulty Level: " + LevelText$(NewValue%)
  8. End Sub
  9.  
  10. Sub OkButton_Click ()
  11.     For i% = 1 To 2
  12.         Players(i%).Name = PlayerName(i% - 1).Text
  13.         Players(i%).Score = 0
  14.     Next i%
  15.     PlayerInfoForm.Hide
  16. End Sub
  17.  
  18. Sub Form_Load ()
  19.     LevelText$(1) = "Beginner"
  20.     LevelText$(2) = "Intermediate"
  21.     LevelText$(3) = "Advanced"
  22.     For i% = 1 To 2
  23.         PlayerName(i% - 1).Text = Players(i%).Name
  24.         LevelButton(i% - 1).Value = Players(i%).Level
  25.         LevelButton(i% - 1).Caption = LevelText$(Players(i%).Level)
  26.     Next i%
  27. End Sub
  28.  
  29. Sub PlayerName_KeyPress (Index As Integer, KeyAscii As Integer)
  30.     If KeyAscii = 13 Then
  31.         OkButton.SpecialOp = 1
  32.         KeyAscii = 0
  33.     End If
  34. End Sub
  35.  
  36.